/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package YottaTron;

import java.awt.image.BufferedImage;
import java.io.IOException;

/**
 *
 * @author Cenda
 */
public class RotatingGraphicsLoader extends GraphicsLoader{

   
    public BufferedImage[] rotatedImages;
    

   

    public RotatingGraphicsLoader(String fileName) throws IOException {
        super(fileName);
        rotatedImages = new BufferedImage[180];
        for (int i = 0; i < rotatedImages.length; i++) {
            rotatedImages[i] = rotate(Math.toRadians(i*2),im);
        }
    }

    public RotatingGraphicsLoader(String fileName, String shapeFileName) throws IOException {
        super(fileName,shapeFileName);
        rotatedImages = new BufferedImage[180];
        for (int i = 0; i < rotatedImages.length; i++) {
            rotatedImages[i] = rotate(Math.toRadians(i*2),im);
        }
    }
    
    
    
    @Override
    public BufferedImage getImage(double angle) {
        return rotatedImages[(int)Math.floor(Math.toDegrees(angle)/2)];
    }
    
   
}
